#ifndef ERROR_H_
#define ERROR_H_

#include <exception>
#include <sstream>

class UnexpectedTokenException : public std::exception
{
private:
	int index;
	char message[256];
public:
	UnexpectedTokenException(int index)
		: index(index)
	{
		sprintf(this->message, "Unexpected token at index: %d", index);
	}

	const char *what() const
	{
		return this->message;
	}
};

class EOEException : public std::exception
{
private:
	char message[256];
public:
	EOEException()
	{
	}

	const char *what() const
	{
		return "Unexpected end of expression.";
	}
};

class InvalidExpressionException : public std::exception
{
private:
	char message[256];
public:
	InvalidExpressionException(const char *msg)
	{
		strcpy_s(message, 256, msg);
	}

	const char *what() const
	{
		return this->message;
	}
};

#endif